CASSPYTHON-13: Remove eventlet, gevent and twisted event loops#1293
CASSPYTHON-13: Remove eventlet, gevent and twisted event loops#1293brettabamonte wants to merge 3 commits into
Conversation
|
Thanks for the PR @brettabamonte! CASSPYTHON-13 is currently aimed at 3.31.0, which is our next minor version bump. We're currently working on getting 3.30.1 out the door; we're close but (as always) it's the details that bog ya down. I mention all of this to say that I'll probably hold off on merging this until 3.30.1 has actually been released. I don't want to merge something aimed at a future release until we know we're good with the current one... otherwise you wind up in the land of reverts, and nobody wants to be there. :) As soon as 3.30.1 is out we'll be shifting to 3.31.0 pretty quickly... and this removal is definitely a significant part of what we're planning for 3.31.0. Thanks again! |
Thanks for the heads up @absurdfarce. Is there anything for the 3.30.1 release that could use an extra set of hands? Happy to help get more involved in the project. If not, are there any items from the TODO list that should get focus for 3.31.0? |
|
Hey @brettabamonte, apologies for the delay... as usual trying to juggle too many balls and dropping most of them. :( I would encourage you to join the #cassandra-drivers channel on ASF Slack (if you haven't done so already). There's a discussion ongoing there on this very point; we're discussing the next release or two for the Python and CPP drivers. I can certainly set you up with an invite if you need one. Short version: there's a debate about whether the next Python release should be 3.31.0 or 4.0.0. If we do bump it to a major release there are several new things that could come into scope there. I need to put together a doc describing what that would look like... just haven't had time yet. By far the most significant change in 3.31.0/4.0.0 (whichever way we go) will be getting the asyncio reactor to a production-grade quality so that at some point in the not-too-distant future it can become the default. There are several tickets covering changes to those reactors but those need to be evaluated in a more systematic way. The most important question around this effort, though, is testing... what do we need to see to convince ourselves that we're safe to put asyncio into consideration when choosing a reactor? What about making it the default reactor? I'd welcome anything you could offer in that space, especially anything around the question of testing. But again, the best thing to do is probably to get you on ASF Slack so that you can become part of the conversation there. Let me know if you need an invite! |
|
@absurdfarce thanks for the reply! Certainly will contribute any way I can. Could I receive a slack invitation to my personal email, abamonteb@gmail.com. I do not have an apache.org email. |
|
Okay, now that 3.30.1 is out the door we're ready to shift over to work on 4.0... which includes the changes referenced in this PR. I'll try to get this one on my queue @brettabamonte so we can get this merged and see what else needs to be done for 4.0! |
e2d724e to
33d10da
Compare
|
@brettabamonte I rebased your commits onto the current HEAD of trunk so that we can merge this cleanly once we're ready. I'm going to kick off another Jenkins run with these changes in order to make sure nothing regressed but I'm not anticipating a problem there. Please double-check me to make sure we haven't lost any content. |
absurdfarce
left a comment
There was a problem hiding this comment.
Looks good, nice work @brettabamonte!
| @@ -22,8 +22,6 @@ | |||
| from cassandra import ConsistencyLevel | |||
There was a problem hiding this comment.
Note to self: the changes here will stomp on the PR to get test_ssl.py working again. That's not a problem; we need both of these changes for 4.x so it has to happen one way or another. Just making the note here so I don't forget it.
| cython>=3.0 | ||
| packaging | ||
| asynctest | ||
| cryptography>=42.0 No newline at end of file |
There was a problem hiding this comment.
We used to get cryptography in our venv as a transitive dependency of Twisted. Now that that has been removed (correctly) we need to explicitly add cryptography here to make the column encryption tests happy.
|
Huh, not sure how that Copilot review got kicked off... guess I must've pushed the wrong button somewhere. Oh well, no biggie, we'll see what it says and see if any additional changes need to be made. |
There was a problem hiding this comment.
Pull request overview
Removes support for the eventlet, gevent, and Twisted event loop implementations from the Cassandra Python driver, along with associated CI/test infrastructure and pyOpenSSL-specific handling paths (notably in SSL-related codepaths and docs).
Changes:
- Deleted the Twisted/gevent/eventlet reactor implementations and their unit tests/utilities; simplified default connection-class selection logic accordingly.
- Removed Twisted/gevent/eventlet dependencies from tox/test requirements and pruned CI/Jenkins configuration to stop running those loop-specific jobs.
- Dropped pyOpenSSL-specific behavior from docs and a few runtime paths (cloud config helper and Insights reporter).
Reviewed changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tox.ini | Removes eventlet/gevent/twisted deps and dedicated tox envs for those loops. |
| tests/unit/io/utils.py | Removes monkey-patch helper used by removed loop tests. |
| tests/unit/io/test_twistedreactor.py | Deletes Twisted reactor unit tests. |
| tests/unit/io/test_libevreactor.py | Removes monkey-patch skip/decorators tied to removed loops. |
| tests/unit/io/test_geventreactor.py | Deletes gevent reactor unit tests. |
| tests/unit/io/test_eventletreactor.py | Deletes eventlet reactor unit tests. |
| tests/unit/io/test_asyncorereactor.py | Removes monkey-patch skip/decorators; keeps asyncore tests gated by Python version. |
| tests/unit/io/test_asyncioreactor.py | Removes monkey-patch skip and simplifies skip logic. |
| tests/unit/io/gevent_utils.py | Deletes gevent unpatch utilities (no longer needed). |
| tests/unit/io/eventlet_utils.py | Deletes eventlet unpatch utilities (no longer needed). |
| tests/integration/standard/test_connection.py | Removes monkey-patch-based test skipping tied to removed loops. |
| tests/integration/long/test_ssl.py | Removes pyOpenSSL branches and standardizes on stdlib ssl usage (but see review comments). |
| tests/integration/long/test_ipv6.py | Removes monkey-patch gating for libev/asyncore imports. |
| tests/init.py | Removes monkey-patch detection and gevent/eventlet/twisted connection_class selection. |
| test-requirements.txt | Drops twisted/gevent/eventlet; adds cryptography floor consistent with repo usage. |
| Jenkinsfile | Removes Twisted/gevent/eventlet options and their unit-test runs from the CI matrix. |
| docs/security.rst | Removes pyOpenSSL/Twisted/Eventlet SSL documentation. |
| docs/installation.rst | Removes deprecation/removal note for gevent/eventlet/Twisted loops. |
| docs/cloud.rst | Removes Eventlet-related cloud limitation note. |
| docs/api/index.rst | Removes API doc entries for removed reactors. |
| docs/api/cassandra/io/twistedreactor.rst | Deletes Twisted reactor API doc page. |
| docs/api/cassandra/io/geventreactor.rst | Deletes gevent reactor API doc page. |
| docs/api/cassandra/io/eventletreactor.rst | Deletes eventlet reactor API doc page. |
| cassandra/io/twistedreactor.py | Deletes Twisted reactor implementation. |
| cassandra/io/geventreactor.py | Deletes gevent reactor implementation. |
| cassandra/io/eventletreactor.py | Deletes eventlet reactor implementation. |
| cassandra/datastax/insights/reporter.py | Drops pyOpenSSL-specific SSLContext handling; assumes stdlib ssl.SSLContext. |
| cassandra/datastax/cloud/init.py | Removes pyOpenSSL context creation and related parameters. |
| cassandra/connection.py | Removes gevent-specific Queue import path. |
| cassandra/cluster.py | Removes gevent/eventlet/twisted detection/import paths and cloud pyOpenSSL context wiring. |
| benchmarks/base.py | Removes Twisted benchmark support/flags. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ssl_options = {'ca_certs': CLIENT_CA_CERTS, | ||
| 'ssl_version': ssl_version, | ||
| 'keyfile': DRIVER_KEYFILE} | ||
|
|
||
| if not USES_PYOPENSSL: | ||
| # I don't set the bad certfile for pyopenssl because it hangs | ||
| ssl_options['certfile'] = DRIVER_CERTFILE_BAD | ||
|
|
||
| cluster = TestCluster( |
| from tests.integration import ( | ||
| get_cluster, remove_cluster, use_single_node, start_cluster_wait_for_up, EVENT_LOOP_MANAGER, TestCluster | ||
| ) |
| ssl_version = ssl.PROTOCOL_TLS | ||
| verify_certs = {'cert_reqs': ssl.CERT_REQUIRED, | ||
| 'check_hostname': True} |
@absurdfarce Thanks for the review. Been busy with work so getting back to this today :) |
Drops support for the eventlet, gevent, and twisted event loops.
Went through:
By dropping these three event loops I don't see why clients would use
pyOpenSSL. As a result I dropped all lingering support for it incassandra/datastax/insights/reporter.py.Addresses: https://issues.apache.org/jira/browse/CASSPYTHON-13
Testing: